home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 018a / arj239f.zip / TECHNOTE.DOC < prev    next >
Text File  |  1993-03-19  |  8KB  |  179 lines

  1.  
  2.      ARJ TECHNICAL INFORMATION                                  April 1993
  3.  
  4.  
  5.      ** IMPORTANT NEWS ****************************************************
  6.  
  7.      Some archiver support programs have incorporated ARJ archive
  8.      identification schemes that are not reliable.  At ARJ 2.39, there
  9.      are now two versions of the large self-extraction module.  The 17K
  10.      byte ARJSFX module supports ARJ-SECURITY.  The standard 15K byte
  11.      ARJSFX module does NOT support ARJ-SECURITY.  For the first time, the
  12.      ARJ-SECURITY fields in the main ARJ header are publicly defined.
  13.  
  14.      In addition, the main ARJ header in self-extracting archives does NOT
  15.      immediately follow the EXE module now.
  16.  
  17.      ARJ has used the same ARJ archive identification scheme since ARJ
  18.      1.0.  The following is the algorithm:
  19.  
  20.      (1) find the ARJ header id bytes 0x60, 0xEA,
  21.      (2) read the next two bytes as the header record size in bytes,
  22.      (3) if the record size is greater than 2600, go back to the header
  23.          id file position, increment the file position, and go back to
  24.          step (1),
  25.      (4) read the header record based upon the previous byte count,
  26.      (5) calculate the 32 bit CRC of the header record data,
  27.      (6) read the next four bytes as the actual header record CRC,
  28.      (7) if the actual CRC does not equal the calculated CRC, go back
  29.          to the header id file position, increment the file position,
  30.          and go back to step (1).
  31.  
  32.      This algorithm is fully demonstrated in the UNARJ C source code.
  33.  
  34.      There is an extended header bug in older versions of ARJ, AV.C and
  35.      UNARJ.C.  The extended header processing in read_header() should
  36.      skip 4 bytes for the extended header CRC and not 2.  This is NOT a
  37.      current problem as no versions of ARJ use the extended header.
  38.  
  39.      **********************************************************************
  40.  
  41.  
  42.      Modification history:
  43.      Date      Description of modification:
  44.      --------  ------------------------------------------------------------
  45.      03/17/93  Added information about ARJSFX change.
  46.      02/17/93  Added description of ARJ security fields.
  47.                Added archive date-modified field.
  48.      12/03/91  Added BACKUP flag to header arj flags.
  49.      11/21/91  Described the two types of headers separately.
  50.      11/11/91  Added information about the change in text mode processing.
  51.      06/28/91  Added several new HOST OS numbers.
  52.      05/19/91  Improved the description of extended header processing.
  53.      05/11/91  Simplified this document.  Added volume label type.
  54.      03/11/91  Added directory file type.
  55.      02/23/91  Added more comments.
  56.      01/10/91  Corrected timestamp description and header order of file mode.
  57.      10/30/90  Corrected values of flags in ARJ flags.
  58.  
  59.  
  60.      ARJ archives contains two types of header blocks:
  61.  
  62.     Archive main header - This is located at the head of the archive
  63.     Local file header   - This is located before each archived file
  64.  
  65.      Structure of main header (low order byte first):
  66.  
  67.      Bytes Description
  68.      ----- -------------------------------------------------------------------
  69.        2   header id (main and local file) = 0x60 0xEA
  70.        2   basic header size (from 'first_hdr_size' thru 'comment' below)
  71.          = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  72.          = 0 if end of archive
  73.                  maximum header size is 2600
  74.  
  75.        1   first_hdr_size (size up to and including 'extra data')
  76.        1   archiver version number
  77.        1   minimum archiver version to extract
  78.        1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MAC-OS)
  79.              (5 = OS/2, 6 = APPLE GS, 7 = ATARI ST, 8 = NEXT)
  80.              (9 = VAX VMS)
  81.        1   arj flags
  82.              (0x01 = NOT USED)
  83.                      (0x02 = OLD_SECURED_FLAG)
  84.              (0x04 = VOLUME_FLAG)  indicates presence of succeeding
  85.                        volume
  86.              (0x08 = NOT USED)
  87.              (0x10 = PATHSYM_FLAG) indicates archive name translated
  88.                        ("\" changed to "/")
  89.              (0x20 = BACKUP_FLAG) indicates backup type archive
  90.                      (0x40 = SECURED_FLAG)
  91.        1   security version (2 = current)
  92.        1   file type        (must equal 2)
  93.        1   reserved
  94.        4   date time when original archive was created
  95.        4   date time when archive was last modified
  96.        4   archive size (currently used only for secured archives)
  97.        4   security envelope file position
  98.        2   filespec position in filename
  99.        2   length in bytes of security envelope data
  100.        2   (currently not used)
  101.        ?   (currently none)
  102.  
  103.        ?   filename of archive when created (null-terminated string)
  104.        ?   archive comment  (null-terminated string)
  105.  
  106.        4   basic header CRC
  107.  
  108.        2   1st extended header size (0 if none)
  109.        ?   1st extended header (currently not used)
  110.        4   1st extended header's CRC (not present when 0 extended header size)
  111.  
  112.  
  113.      Structure of local file header (low order byte first):
  114.  
  115.      Bytes Description
  116.      ----- -------------------------------------------------------------------
  117.        2   header id (main and local file) = 0x60 0xEA
  118.        2   basic header size (from 'first_hdr_size' thru 'comment' below)
  119.          = first_hdr_size + strlen(filename) + 1 + strlen(comment) + 1
  120.          = 0 if end of archive
  121.                  maximum header size is 2600
  122.  
  123.        1   first_hdr_size (size up to and including 'extra data')
  124.        1   archiver version number
  125.        1   minimum archiver version to extract
  126.        1   host OS   (0 = MSDOS, 1 = PRIMOS, 2 = UNIX, 3 = AMIGA, 4 = MAC-OS)
  127.              (5 = OS/2, 6 = APPLE GS, 7 = ATARI ST, 8 = NEXT)
  128.              (9 = VAX VMS)
  129.        1   arj flags (0x01 = GARBLED_FLAG) indicates passworded file
  130.                      (0x02 = NOT USED)
  131.              (0x04 = VOLUME_FLAG)  indicates continued file to next
  132.                        volume (file is split)
  133.              (0x08 = EXTFILE_FLAG) indicates file starting position
  134.                        field (for split files)
  135.              (0x10 = PATHSYM_FLAG) indicates filename translated
  136.                        ("\" changed to "/")
  137.              (0x20 = BACKUP_FLAG)  indicates file marked as backup
  138.        1   method    (0 = stored, 1 = compressed most ... 4 compressed fastest)
  139.        1   file type (0 = binary,    1 = 7-bit text)
  140.              (3 = directory, 4 = volume label)
  141.        1   reserved
  142.        4   date time modified
  143.        4   compressed size
  144.        4   original size (this will be different for text mode compression)
  145.        4   original file's CRC
  146.        2   filespec position in filename
  147.        2   file access mode
  148.        2   host data (currently not used)
  149.        ?   extra data
  150.        4 bytes for extended file starting position when used
  151.            (these bytes are present when EXTFILE_FLAG is set).
  152.            0 bytes otherwise.
  153.  
  154.        ?   filename (null-terminated string)
  155.        ?   comment  (null-terminated string)
  156.  
  157.        4   basic header CRC
  158.  
  159.        2   1st extended header size (0 if none)
  160.        ?   1st extended header (currently not used)
  161.        4   1st extended header's CRC (not present when 0 extended header size)
  162.  
  163.        ...
  164.  
  165.        ?   compressed file
  166.  
  167.  
  168.      Time stamp format:
  169.  
  170.         31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
  171.        |<---- year-1980 --->|<- month ->|<--- day ---->|
  172.  
  173.     15 14 13 12 11 10  9  8  7  6  5  4  3    2  1  0
  174.        |<--- hour --->|<---- minute --->|<- second/2 ->|
  175.  
  176.  
  177.      end of document
  178.  
  179.